**************************************************************
*HURRICANES AND GAS GOUGING
* 	CODE BY: GABE LADE, TIM BEATTY, AND JAY SHIMSHACK
**************************************************************
clear all
set more off
capture log close
set excelxlsxlargefile on
set maxvar 120000 				

*DESIGNATE OUTPUT DATE
global outputdate = "20200704"		 

*DESIGNATE DIRECTORY 
cd "C:\Users\glade\Dropbox\Work\RESEARCH\Gabe_Tim_Jay_Gas_Gouging\"

*FOLDER DESIGNATIONS
global code "codeSTATA\"
global data_clean "dataSTATA"
global figs "figSTATA"
global output "outSTATA"
global data_whole "dataRAW\OPIS_Rack_Data"
global data_ret "dataRAW\OPIS_Data"
global temp "dataSTATA\temp"

*************************************
*I. DATA COMPILE
*************************************
do $code\1a_datacompile_rack
do $code\1b_datacompile_retail 

*************************************
*II. DATA CLEAN
*************************************
use $data_clean\WORKING_MAINDATA, clear
xtset FuellocationID date
do $code\2a_dataclean

*****************************************************************
*III. SUMMARY STATISTICS
*****************************************************************
use $data_clean\gouging_clean_20191124, clear
sort station_id date
xtset station_id date
do $code\3a_sumstats
 
********************************
*IV. MAIN REGRESSIONS
********************************
do $code\4a_mainregs_price_margins 
do $code\4b_mainregs_reporting 

********************************
*V. APPPENDIX
********************************
do $code\5a_app_sum_stats
do $code\5b_app_robust_prices
do $code\5c_app_robust_reporting
do $code\5d_station_effects
do $code\5e_hurricane_effects
do $code\5f_twfe_models